Skip to content

[capital] Code generation: update services and models#465

Merged
thomasc-adyen merged 1 commit intomainfrom
sdk-automation/capital
Mar 23, 2026
Merged

[capital] Code generation: update services and models#465
thomasc-adyen merged 1 commit intomainfrom
sdk-automation/capital

Conversation

@AdyenAutomationBot
Copy link
Collaborator

This PR contains the automated changes for the capital service.

The commit history of this PR reflects the adyen-openapi commits that have been applied.

@AdyenAutomationBot AdyenAutomationBot requested review from a team as code owners March 23, 2026 13:19
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the capital service by introducing new functionalities related to dynamic offers and refining the terminology for existing grant offers. It integrates a new API client for managing dynamic offers and clarifies the naming of "grant offers" to "static offers" within the GrantOffersApi documentation.

Highlights

  • New Dynamic Offers API: Introduced DynamicOffersApi to manage dynamic offers, including methods for calculating preliminary offers, creating static offers, and retrieving all available dynamic offers.
  • Capital Service Integration: Integrated the new DynamicOffersApi into the AdyenCapitalApi service, making its functionalities accessible.
  • Terminology Refinement: Updated docstrings in GrantOffersApi to explicitly refer to "grant offers" as "static offers" for improved clarity.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@sonarqubecloud
Copy link

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces automated changes for the capital service, primarily by adding a new DynamicOffersApi. The changes are generally sound, but I've identified a couple of areas for improvement in the newly generated code. My feedback focuses on enhancing maintainability by reducing code duplication and adhering to Python best practices by avoiding shadowing built-in functions. Addressing these points in the code generator will improve the quality of future automated changes.

Comment on lines +13 to +14
self.service = "capital"
self.baseUrl = "https://balanceplatform-api-test.adyen.com/capital/v1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The service and baseUrl attributes are hardcoded and duplicated across all API classes in the capital service (DynamicOffersApi, GrantAccountsApi, GrantOffersApi, GrantsApi). This violates the DRY (Don't Repeat Yourself) principle and makes maintenance harder. To improve maintainability, consider defining these in a shared base class for all capital services or as constants in a shared module.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good feedback, but not in scope of this PR as it's generated code. We can create a follow-up ticket internally

Comment on lines +17 to +22
self, request, id, idempotency_key=None, **kwargs
):
"""
Calculate a preliminary offer for a selected financing amount
"""
endpoint = self.baseUrl + f"/dynamicOffers/{id}/calculate"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The parameter name id shadows the built-in Python function id(). According to the PEP 8 style guide, it is recommended to use a trailing underscore like id_ to avoid such conflicts.

Suggested change
self, request, id, idempotency_key=None, **kwargs
):
"""
Calculate a preliminary offer for a selected financing amount
"""
endpoint = self.baseUrl + f"/dynamicOffers/{id}/calculate"
self, request, id_, idempotency_key=None, **kwargs
):
"""
Calculate a preliminary offer for a selected financing amount
"""
endpoint = self.baseUrl + f"/dynamicOffers/{id_}/calculate"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good feedback, but not in socpe as this is generated code

Comment on lines +28 to +32
def create_static_offer_from_dynamic_offer(self, request, id, idempotency_key=None, **kwargs):
"""
Create a static offer for a selected financing amount
"""
endpoint = self.baseUrl + f"/dynamicOffers/{id}/grantOffer"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The parameter name id shadows the built-in Python function id(). According to the PEP 8 style guide, it is recommended to use a trailing underscore like id_ to avoid such conflicts.

Suggested change
def create_static_offer_from_dynamic_offer(self, request, id, idempotency_key=None, **kwargs):
"""
Create a static offer for a selected financing amount
"""
endpoint = self.baseUrl + f"/dynamicOffers/{id}/grantOffer"
def create_static_offer_from_dynamic_offer(self, request, id_, idempotency_key=None, **kwargs):
"""
Create a static offer for a selected financing amount
"""
endpoint = self.baseUrl + f"/dynamicOffers/{id_}/grantOffer"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good feedback, but not in scope as generated code

@thomasc-adyen thomasc-adyen added this pull request to the merge queue Mar 23, 2026
Merged via the queue into main with commit ef08bef Mar 23, 2026
26 checks passed
@thomasc-adyen thomasc-adyen deleted the sdk-automation/capital branch March 23, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants